using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using JGSY.CMS.LowCode.Platform.Domain.Entities;

namespace JGSY.CMS.LowCode.Platform.Domain.Interfaces
{
    /// <summary>
    /// 表单提交仓储接口
    /// </summary>
    public interface IFormSubmissionRepository : IRepository<FormSubmission>
    {
        /// <summary>
        /// 根据表单ID获取提交列表
        /// </summary>
        /// <param name="formId">表单ID</param>
        /// <returns>提交列表</returns>
        Task<List<FormSubmission>> GetByFormIdAsync(long formId);

        /// <summary>
        /// 根据提交者获取提交列表
        /// </summary>
        /// <param name="submitterEmail">提交者邮箱</param>
        /// <returns>提交列表</returns>
        Task<List<FormSubmission>> GetBySubmitterAsync(string submitterEmail);

        /// <summary>
        /// 获取表单提交统计
        /// </summary>
        /// <param name="formId">表单ID</param>
        /// <returns>统计信息</returns>
        Task<Dictionary<string, int>> GetSubmissionStatisticsAsync(long formId);

        /// <summary>
        /// 获取最近提交列表
        /// </summary>
        /// <param name="days">天数</param>
        /// <returns>最近提交列表</returns>
        Task<List<FormSubmission>> GetRecentSubmissionsAsync(int days = 7);

        /// <summary>
        /// 根据状态获取提交列表
        /// </summary>
        /// <param name="status">状态</param>
        /// <returns>提交列表</returns>
        Task<List<FormSubmission>> GetByStatusAsync(string status);

        /// <summary>
        /// 批量更新提交状态
        /// </summary>
        /// <param name="ids">提交ID列表</param>
        /// <param name="status">新状态</param>
        /// <returns>是否成功</returns>
        Task<bool> BatchUpdateStatusAsync(List<long> ids, string status);
    }
}
